#!/bin/bash

# XXL-Job Admin 配置
BASE_URL="http://172.16.104.108:9090/xxl-job-admin"
LIST_ENDPOINT="${BASE_URL}/jobinfo/pageList"
COOKIE_FILE="cookies.txt"

# 查询参数
JOB_GROUP="9"
TRIGGER_STATUS="-1"  # -1表示查询所有状态
START_PAGE="0"        # 起始页码，从0开始
PAGE_SIZE="10"        # 每页条数

# 发送查询请求
echo "正在查询任务列表..."
curl -X POST "${LIST_ENDPOINT}" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -b "${COOKIE_FILE}" \
  -d "jobGroup=${JOB_GROUP}" \
  -d "triggerStatus=${TRIGGER_STATUS}" \
  -d "jobDesc=" \
  -d "executorHandler=" \
  -d "author=" \
  -d "start=${START_PAGE}" \
  -d "length=${PAGE_SIZE}"

#curl -X POST http://172.16.104.108:9090/xxl-job-admin/jobinfo/pageList -H "Content-Type: application/x-www-form-urlencoded" -b cookies.txt -d "jobGroup=9&triggerStatus=-1&jobDesc=&executorHandler=&author=&start=0&length=10"